package char_sequence;

public class CharacterStrings extends Object implements CharSequence{

    private final char[] value;
    private final int size;

    public CharacterStrings(String s ) {
        if( s == null ) {
            this.value = null ;
            this.size = -1 ;
        } else {
            this.size = s.length() ;
            this.value = new char[ this.size ];
            s.getChars( 0 ,  size , value , 0 );
        }
    }


    @Override
    public int length() {
        return 0;
    }

    @Override
    public char charAt(int index) {
        return 0;
    }

    @Override
    public CharSequence subSequence(int start, int end) {
        return null;
    }

    @Override
    public String toString() {
        return new String( this.value );
    }

    public static void main(String[] args) {
        CharacterStrings s = new CharacterStrings( "hello,world" );
        System.out.println( s.length() );
        System.out.println( s );

        CharSequence c = s.subSequence( 0 ,  6 );
        System.out.println( c.length() );
        System.out.println( c );
    }


}
